Skip to content

Fix formatting markdown java code block with empty lines - #5267

Merged
jjohnstn merged 1 commit into
eclipse-jdt:masterfrom
jjohnstn:javacodeformat
Aug 5, 2026
Merged

Fix formatting markdown java code block with empty lines#5267
jjohnstn merged 1 commit into
eclipse-jdt:masterfrom
jjohnstn:javacodeformat

Conversation

@jjohnstn

@jjohnstn jjohnstn commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What it does

Fixes formatting a markdown comment with a java code block that has empty lines.

How to test

See issue or new test.

Author checklist

- fix the line start calculation in CommentsPreparator.getCodeToFormat()
  which assumed a blank came after the markdown opening comment but
  does not in the case of an empty comment
- add new test to FormatterMarkdownCommentsTests
- fixes eclipse-jdt#5220
@jjohnstn jjohnstn self-assigned this Aug 5, 2026
@jjohnstn jjohnstn added bug Something isn't working regression Something was broken by a previous change labels Aug 5, 2026
@jjohnstn jjohnstn added this to the 4.41 M3 milestone Aug 5, 2026
@jjohnstn
jjohnstn merged commit d886c7d into eclipse-jdt:master Aug 5, 2026
13 checks passed
@jjohnstn
jjohnstn deleted the javacodeformat branch August 5, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working regression Something was broken by a previous change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Formatter] Blank /// Markdown line in code block merged with next line into /// ///

1 participant